home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 2
/
Atari Mega Archive CD - Volume 2.iso
/
minix
/
up1510b.tgz
/
up1510b
/
doc
/
net.doc
< prev
next >
Wrap
Text File
|
1990-07-19
|
44KB
|
841 lines
MINIX NETWORKING
1. INTRODUCTION
Network software can be divided into two general categories differing
in the way the software is integrated into the operating system and the user
software. When networks first developed, they were used over slow wide-area
links (56 kbps or less), so the designers' main concern was using the
available bandwidth efficiently. Programmer convenience was not considered.
Later, as higher bandwidth networks became widespread (especially local area
networks, such as Ethernet), the focus changed from worrying about bandwidth
utilization, to worrying about making the network interface convenient for
the programmers. This evolution is very similar to the evolution from
assembly language programming, where the machine came first, to programming
in high level languages, where the programmer came first.
Networks of the first type of are said to be connection oriented, and use
what are called sliding window protocols. All older networks, especially
wide area networks, are of this type. Some of the better known protocols are
X.25, TCP/IP, and OSI. Networks of the second type are connectionless, and
use what is called remote procedure call (RPC). Virtually all modern
distributed operating systems are based on this concept. Some well-known
examples are the work of Xerox PARC [1], the V kernel [2], and Amoeba [3-9].
While it is certainly possible to build RPC on top of a connection-oriented
protocol, this approach is inefficient compared to building the RPC on top of
the bare network. For an introduction to connection-oriented protocols, RPC,
and networking in general, see [10].
Networking in MINIX is based on RPC. Briefly summarized, communication
between two processes works as follows. One of the processes, called the
server, has some service to offer, such as a file storage. The other process,
the client, wants to use this service. The interface to the service consists
of a collection of procedures that the client can call. In the case of a file
server, the procedures might be CREATE_FILE, RENAME_FILE, READ_DATA,
WRITE_DATA, and so on. These are library routines available on the client's
machine.
When the client calls one of these procedures, the procedure sends a
message to the server containing the procedure name and its parameters. The
procedure then blocks waiting for the reply. When the message gets to the
server, it is decoded there and executed. The reply is sent back to the
calling procedure on the client's machine, which then returns the results to
the caller. From the programmer's point of view, having remote services in the
network essentially means that there is a new collection of procedures to
call. The programmer is not burdened with concepts like opening connections,
sending data, or thinking in terms of acknowledgements, all of which are
needed in the connection-oriented model. Nor is the network software burdened
with having to manage connections.
In effect, RPC is based on the abstraction of the procedure call, whereas
connection-oriented networks are based on the much lower-level concept of
making the network look like an input/output device. While at first glance it
might seem that connection-oriented networking could be made to fit with the
UNIX/MINIX concept of a pipe, pipes are set up in a very different way (by a
common ancestor), and fit very poorly to the most common style of local area
network programming, where the client has a request and the server gives a
response. With wide area networks, this kind of interaction is painfully slow,
due to the low bandwidth, so the only services generally available are mail
and file transfer, which are batch-oriented. MINIX networking has been
designed for interactive use on high performance local area networks, so for
this reason, RPC has been chosen over the older connection-oriented style.
In particular, MINIX networking has been designed to be compatible with
the form of RPC used in the Amoeba distributed operating system [3-9]. Not
only have the concepts and the implementation been well tested, but the
performance is exceedingly good. For example, for doing file transfers,
something that connection-oriented protocols are supposed to be good at,
Amoeba running on two Sun 3s achieves triple the throughput of TCP/IP running
on the same hardware. Data transfers between two Zenith Z-248s running
the Amoeba RPC on MINIX have been measured at 165 kbytes/sec, almost as fast
as TCP/IP transfers between two Sun 3/50s. Considering that the Suns are
two times as fast as the Z-248s and the network software is 100% CPU
limited (doubling the CPU speed doubles the throughput), this is a strong
argument for the Amoeba RPC. As a final statistic, the RPC throughput between
a client and server located on the same Z-248 is 1.5 Mbytes/sec, an extremely
high figure for this class of machine, and much better than what Suns and VAXes
normally achieve locally, despite their greater CPU power. In conclusion,
although RPC was chosen for its elegance and ease of use, it turns out that it
also has excellent performance, even doing things like bulk transfer, and
certainly doing things like short request-reply interactions.
A few words about Amoeba are probably in order here. It is a distributed
operating system that was developed at the Vrije Universiteit in Amsterdam and
is now being used there, at the Centre for Mathematics and Computer Science in
Amsterdam, and a number of other research centers in several countries. It is
written in C and currently runs on a wide variety of microprocessors and
minicomputers (including the Sun 3, various other MC68020 systems, the PDP 11
and the DEC Vax). Note that Amoeba is a complete operating system, just like
UNIX, MINIX or VMS. The only relation between Amoeba and MINIX is that MINIX
networking uses the Amoeba RPC protocols. Other than that they are quite
different in structure, funtionality, and goals. Amoeba was designed to run
on systems consisting of dozens of processors, and yet give the programmer the
illusion that it is a traditional single-CPU time sharing system. For more
information about Amoeba, see the references.
2. OBJECTS
Amoeba is an object-oriented system, and to a considerable extent this
orientation is reflected in the protocol. As a consequence, MINIX also
acquires a certain object-orientation. Very briefly, an object is a programmer
defined abstract data type that has well-defined operations on it. As an
example, a file server could define file and directory objects, and provide
operations to read and write the file objects, and insert files in, and delete
files from, directory objects. Clients can perform these operations by doing
RPCs with the file server. Henceforth we will adopt the Amoeba terminology and
call these RPCs "transactions." A transaction consists of a request message
from a client to a server, followed by a reply message from the server back to
the client.
It is up to the writer of each server to decide what kinds of objects the
server will support and what operations will be available on them. The
structure of the system guarantees that clients can only perform the
operations provided by the server. This style of networking is intended to
force constraints on programmers, just as high-level languages force
constraints on former assembly-language programmers.
Objects are normally protected by capabilities, which are currently 128-
bit numbers, although in the the next version of Amoeba (Amoeba 4.0) this will
become 256 bits. When a client asks a server to create an object, the server
returns a capability for the object. This capability must be presented by the
client to perform subsequent operations on the object. In Amoeba, capabilities
are protected crytographically. Since the MINIX kernel, unlike the Amoeba
kernel, was not designed from scratch as a distributed system, the protection
aspects in MINIX are not fully implemented.
A capability has 4 fields, described below. These fields are important
because they appear in the Amoeba and